package com.pair.micro.common.constant;

public enum ErrCodeEnum {
	
	CODE0(0,"执行成功"),
	CODE1(1,"未知错误"),
	CODE2(2,"执行失败"),
	CODE3(3,"接口调用失败（传入接口参数有错误）"),
	CODE4(4,"小乐在忙，请稍后再试"),
	CODE5(5,"接口调用失败（未授权）"),
	CODE6(6,"接口调用失败（未登录）"),
	CODE7(7,"该楼/单元/房间已有用户，请勿删除"),
	CODE8(8,"重复数据"),
	CODE9(9,"该分类下还有小分类，请勿删除"),
	CODE10(10,"已有数据绑定此评价，请勿删除"),
	CODE11(11,"已有数据绑定此评价，请勿修改评语"),
	CODE22(22,"当前工单状态已改变，请重新进入"),
	CODE23(23,"当前工单数据错误，请联系管理员"),
	CODE24(24,"接单人不能为报单人"),
	CODE25(25,"接单人信用积分不符合标准"),
	CODE26(26,"该账号已离职,暂时无法登陆"),
	CODE38(38,"该园区未设置稽查人员，暂不能创建稽查工单"),
	CODE49(49, "请不要重复缴费"),
	CODE51(51, "该工单需要进行手写签名"),
	CODE101(101,"用户名或密码错误"),
	CODE102(102,"名字重复"),
	CODE103(103,"该小区已有默认联系方式"),
	CODE104(104,"该用户不存在"),
	CODE105(105,"手机号重复"),
	CODE106(106,"该离职人员下有未完成的工单，请先提供工单接收人在进行离职办理！"),
    CODE107(107,"积分已同步至锁客链，无法删除订单！"),
	CODE202(202,"验证码错误"),
	CODE203(203,"该手机号码已注册"),
	CODE108(108,"该等级工单评价已超过10条,无法继续添加"),
	CODE201(201,"合同编号重复"),
	CODE204(204,"此小区未设置集团，请先设置集团"),
	CODE301(301,"此小区已设置3位明星业主"),
	CODE401(401,"该业主已缴纳费用不能删除"),
	CODE402(402,"存在已缴费账单不能生成应收"),
	CODE403(403,"按区间从大到小依次删除"),
	CODE501(501,"资源点位类型名称不能为空"),
	CODE502(502,"资源点位类型创建失败，请联系科技研发部"),
	CODE503(503,"添加信息不完整"),
	CODE504(504,"资源点位创建失败，请联系科技研发部"),
	CODE505(505,"资源点位图片查询失败"),
	CODE601(601,"文件不存在"),
    CODE602(602,"该车牌号已存在，保存失败！"),
    CODE701(701,"该房间已存在业主信息。"),
    CODE702(702,"创建虚拟房间失败，请联系管理员。"),
    CODE603(603,"获取WO_TOKEN失败，请联系管理员！"),
    CODE604(604,"保存WO_DEVICE失败，请联系管理员！"),
    CODE605(605,"保存WO_ADMIT失败，请联系管理员！"),
    CODE606(606,"保存WO_FACE失败，请联系管理员！"),
    CODE607(607,"授权WO_AUTH_DEVICE失败，请联系管理员！"),
    CODE608(608,"删除WO_FACE失败，请联系管理员！"),
    CODE610(610,"请输入完整手机号或商户名!");


	private int errCode;
	
	private String errMsg;
	
	private ErrCodeEnum(int errCode, String errMsg) {
		this.errCode = errCode;
		this.errMsg = errMsg;
	}

	public static String getErrMsg(int errCode) {
		for (ErrCodeEnum e : ErrCodeEnum.values()) {
			if (e.getErrCode() == errCode) {
				return e.errMsg;
			}
		}
		return "";
	}

	public int getErrCode() {
		return errCode;
	}

	public void setErrCode(int errCode) {
		this.errCode = errCode;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}
}
